Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update penumbra deps to v80 #48

Merged
merged 6 commits into from
Dec 6, 2024
Merged

Update penumbra deps to v80 #48

merged 6 commits into from
Dec 6, 2024

Conversation

conorsch
Copy link

@conorsch conorsch commented Dec 5, 2024

Bumping the Penumbra dependencies to v0.80.x, specifically on the current main branch of the protocol repo. Ideally we'd tag a v0.80.10, containing fixes from penumbra-zone/penumbra#4905, but we haven't done that just yet.

Notably, the bump in Penumbra protocol deps will involve a schema change for the view database. I haven't tested locally yet, but I expect Hermes when upgraded to throw an error about the view schema mismatch. If and when that happens during interactive testing on the testnet, I'll make sure to document those errors so we can communicate the need to perform maintenance to operators.

Required to resolve a build error when using Rust >1.80:

error[E0282]: type annotations needed for `Box<_>`
  --> /home/conor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
   = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo
update`
Updates the penumbra deps to commit [0] on main branch, including merge
of [1]. The naive dep update breaks builds, so further changes are
required.

[0] ac7abacc9bb09503d6fd6a396bc0b6850079084e
[1] penumbra-zone/penumbra#4905
Bumping cargo deps to resolve build errors.
The ViewServer init fn now requires an arg for registry path.
Given type constraints, setting it to `None` requires pulling in
`camino` as a dep, to satisfy the type `registry_path: Option<impl AsRef<Utf8Path>>`.
At least, this is the best I could do.
@@ -522,10 +522,13 @@ impl ChainEndpoint for PenumbraChain {
}
};

// No support for custom registry.json files in Hermes yet.
let registry_path: Option<camino::Utf8PathBuf> = None;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to avoid pulling in the camino crate as a workspace dep?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to? It's useful

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my intent wasn't clear. I should have asked: "Is explicitly declaring the type Option<camino::Utf8PathBuf> the minimal change necessary to satisfy?"

Copy link
Member

@zbuc zbuc Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

registry_path is an Option<impl AsRef<Utf8Path>> and String implements AsRef<Utf8Path> so we can:

// No support for custom registry.json files in Hermes yet.
let registry_path: Option<String> = None;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's exactly what I was reaching for.

[toolchain]
# Pin Rust 1.79 to avoid API breakage in `time` crate.
channel = "1.79"
components = [ "rustfmt", "rust-analyzer" ]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than pin old rust, maybe we should just add boxing where recommended. I'm sure that's happened in the upstream Hermes already.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They did remove their rust-toolchain.toml file: informalsystems#2706

I'm not sure what the time crate-related API breakage is, though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like they just set the msrv in the Cargo.toml files directly: https://github.com/informalsystems/hermes/blob/master/crates/relayer/Cargo.toml#L10

We have similar but on a different version: https://github.com/penumbra-zone/hermes/blob/main/crates/relayer/Cargo.toml#L5

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the time crate-related API breakage is, though

If you check out the main branch on this repo, without a rust-toolchain.toml file, and run cargo check, you'll see:

error[E0282]: type annotations needed for `Box<_>`
  --> /home/conor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
   = note: this is an inference error on crate `time` caused by an API change in Rust 1.80.0; update `time` to version `>=0.3.35` by calling `cargo
update`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I can cargo check on this branch without the rust-toolchain.toml file. This might be because of the Rust version I have installed?

$ rustc -V
rustc 1.82.0 (f6e511eec 2024-10-15)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit to remove the rust-toolchain.toml and update the msrv to 1.79.0 everywhere

@conorsch conorsch marked this pull request as ready for review December 6, 2024 18:16
@conorsch
Copy link
Author

conorsch commented Dec 6, 2024

Ideally we'd tag a v0.80.10, containing fixes from penumbra-zone/penumbra#4905, but we haven't done that just yet.

Marking ready for review because the code we want is present and we want to move forward with testing.

@conorsch conorsch merged commit 10f5880 into main Dec 6, 2024
29 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants